import axios from 'axios'
axios.defaults.baseURL="/api"

export function findStudents(){
    return axios.get("/student?cmd=list")
}
export function findByPage(page,pageSize){
    return axios.get(`/student?cmd=findByPage&page=${page}&pageSize=${pageSize}`)
}

export function search(page,pageSize,studentSearch){
    return axios.post(`/student?cmd=search&page=${page}&pageSize=${pageSize}`,"stud=" + JSON.stringify(studentSearch))
}

export function save(url,student) {
    return axios.post(url,"stud=" + JSON.stringify(student))
}

export function delStud(sid){
    return axios.get("/student?cmd=delete&sid="+sid)
}